package com.example.activity;

import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import android.widget.TextView;

public class MainActivity2 extends Activity implements OnItemClickListener{
	protected ListView lv;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main2);
        lv=(ListView) findViewById(R.id.listview1);
        String[] arr={"123","345","456","567"};
        ArrayAdapter<String> adapter=new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1,arr);
        lv.setAdapter(adapter);
        lv.setOnItemClickListener(this);
    }

    
    public void goToOne(View v)
    {
    	Intent intent=new Intent();
    	
    }


	@Override
	public void onItemClick(AdapterView<?> arg0, View view, int arg2, long arg3) {
		// TODO Auto-generated method stub
		TextView tv=(TextView) view;
		String phone=tv.getText().toString();
		Intent intent=getIntent();
		intent.putExtra("phone", phone);
		this.setResult(RESULT_OK,intent);
		this.finish();
	}


}
